Skip to content

Update cool.io dependency to ~> 1.8 to fix build on recent Ruby#13

Closed
Watson1978 wants to merge 1 commit intomsgpack-rpc:masterfrom
Watson1978:cool.io
Closed

Update cool.io dependency to ~> 1.8 to fix build on recent Ruby#13
Watson1978 wants to merge 1 commit intomsgpack-rpc:masterfrom
Watson1978:cool.io

Conversation

@Watson1978
Copy link

cool.io 1.7.x fails to build with recent Ruby versions. Updating the runtime dependency to ~> 1.8 resolves this issue and allows the native extension to compile successfully.

Additionally, the bundler development dependency constraint (~> 1.0) has been relaxed to support modern development environments.

$ gem install cool.io -v 1.7.1
Building native extensions. This could take a while...
ERROR:  Error installing cool.io:
        ERROR: Failed to build gem native extension.

    current directory: /home/watson/.rbenv/versions/3.4.9/lib/ruby/gems/3.4.0/gems/cool.io-1.7.1/ext/cool.io
/home/watson/.rbenv/versions/3.4.9/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_alone()... yes
checking for rb_str_set_len()... yes
checking for clock_gettime() in -lrt... yes
checking for ruby/io.h... yes
checking for ruby/thread.h... yes
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... yes
checking for sys/event.h... no
checking for port.h... no
checking for sys/resource.h... yes
creating Makefile

current directory: /home/watson/.rbenv/versions/3.4.9/lib/ruby/gems/3.4.0/gems/cool.io-1.7.1/ext/cool.io
make DESTDIR\= sitearchdir\=./.gem.20260322-9862-z2rih5 sitelibdir\=./.gem.20260322-9862-z2rih5 clean

current directory: /home/watson/.rbenv/versions/3.4.9/lib/ruby/gems/3.4.0/gems/cool.io-1.7.1/ext/cool.io
make DESTDIR\= sitearchdir\=./.gem.20260322-9862-z2rih5 sitelibdir\=./.gem.20260322-9862-z2rih5
compiling cool.io_ext.c
In file included from cool.io_ext.c:11:
cool.io.h:21:23: warning: 'RUBY_VERSION_MAJOR' is not defined, evaluates to '0' [-Wundef]
   21 | #if !HAVE_RB_IO_T || (RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR == 8)
      |                       ^~~~~~~~~~~~~~~~~~
cool.io_ext.c:13:14: warning: 'mCoolio' defined but not used [-Wunused-variable]
   13 | static VALUE mCoolio = Qnil;
      |              ^~~~~~~
cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-parentheses-equality' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-constant-logical-operand' may have been intended to silence earlier diagnostics
compiling iowatcher.c

(...snip...)

../libev/ev.h:738:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  738 | # define ev_set_cb(ev,cb_)                   (ev_cb_ (ev) = (cb_), memmove (&((ev_watcher *)(ev))->cb, &ev_cb_ (ev), sizeof (ev_cb_ (ev))))
      |                                                                              ~^~~~~~~~~~~~~~~~~~~
../libev/ev.h:690:3: note: in expansion of macro 'ev_set_cb'
  690 |   ev_set_cb ((ev), cb_);                        \
      |   ^~~~~~~~~
../libev/ev.c:5103:3: note: in expansion of macro 'ev_init'
 5103 |   ev_init (&once->io, once_cb_io);
      |   ^~~~~~~
../libev/ev.h:687:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  687 |   ((ev_watcher *)(void *)(ev))->active  =       \
      |   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.c:5110:3: note: in expansion of macro 'ev_init'
 5110 |   ev_init (&once->to, once_cb_to);
      |   ^~~~~~~
../libev/ev.h:688:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  688 |   ((ev_watcher *)(void *)(ev))->pending = 0;    \
      |   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.c:5110:3: note: in expansion of macro 'ev_init'
 5110 |   ev_init (&once->to, once_cb_to);
      |   ^~~~~~~
../libev/ev.h:732:50: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  732 | # define ev_set_priority(ev,pri)             (   (ev_watcher *)(void *)(ev))->priority = (pri)
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.h:689:3: note: in expansion of macro 'ev_set_priority'
  689 |   ev_set_priority ((ev), 0);                    \
      |   ^~~~~~~~~~~~~~~
../libev/ev.c:5110:3: note: in expansion of macro 'ev_init'
 5110 |   ev_init (&once->to, once_cb_to);
      |   ^~~~~~~
../libev/ev.h:738:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  738 | # define ev_set_cb(ev,cb_)                   (ev_cb_ (ev) = (cb_), memmove (&((ev_watcher *)(ev))->cb, &ev_cb_ (ev), sizeof (ev_cb_ (ev))))
      |                                                                              ~^~~~~~~~~~~~~~~~~~~
../libev/ev.h:690:3: note: in expansion of macro 'ev_set_cb'
  690 |   ev_set_cb ((ev), cb_);                        \
      |   ^~~~~~~~~
../libev/ev.c:5110:3: note: in expansion of macro 'ev_init'
 5110 |   ev_init (&once->to, once_cb_to);
      |   ^~~~~~~
../libev/ev.h:694:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  694 | #define ev_timer_set(ev,after_,repeat_)      do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
      |                                                   ~^~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.c:5113:7: note: in expansion of macro 'ev_timer_set'
 5113 |       ev_timer_set (&once->to, timeout, 0.);
      |       ^~~~~~~~~~~~
../libev/ev.c: At top level:
../libev/ev.c:5230:27: warning: '/*' within comment [-Wcomment]
 5230 | /* EV_STAT     0x00001000 /* stat data changed */
../libev/ev.c:5231:27: warning: '/*' within comment [-Wcomment]
 5231 | /* EV_EMBED    0x00010000 /* embedded event loop needs sweep */
cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-parentheses-equality' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-constant-logical-operand' may have been intended to silence earlier diagnostics
make: *** [Makefile:251: libev.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/watson/.rbenv/versions/3.4.9/lib/ruby/gems/3.4.0/gems/cool.io-1.7.1 for inspection.
Results logged to /home/watson/.rbenv/versions/3.4.9/lib/ruby/gems/3.4.0/extensions/x86_64-linux/3.4.0/cool.io-1.7.1/gem_make.out

@Watson1978
Copy link
Author

Ah, this is same with #12.

I will close this.

@Watson1978 Watson1978 closed this Mar 22, 2026
@Watson1978 Watson1978 deleted the cool.io branch March 22, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant